<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld"%>

<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品详情页面</title>

<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>

<style type="text/css">
#searchbar{
   margin-bottom: 10px;
   margin-left:15px;
  }
  .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>
<body style="padding:10px">
<div class="navbar">
		<span>您当前的位置：</span>
		商品管理 &gt; 商品明细
</div>

<div><font>商品编码:${commodity.cNo }</font>&nbsp;<font>商品名称:${commodity.cName }</font>&nbsp;<font>商品总库存:${commodity.totalStock }</font></div>
<br />

<div id="maingrid" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- 展示列表数据  -->
</div>

<script>
    var basePath='${BasePath}';
    var grid = null;
    var productData = {"Rows": ${pageProductsJson}, "Total": ${productCount}};
    
    $(function () {
    	
        grid = $("#maingrid").ligerGrid({
            columns: [
            { display: '货品编码', name: 'gNo'},
            { display: '商品名称', name: 'cName'},
            { display: '单位', name: 'unit'},
            { display: '规格', name: 'specification'},
            { display: '货品库存数量', name: 'inventoryQuantity'},
            { display: '进货日期', name: 'purchasesDate'},
            { display: '进货价格', name: 'purchasesPrice'},
            { display: '供应商', name: 'belongSupp'},
            { display: '所属仓库', name: 'belongWarehouse'},
            
            { display: '操作', isSort: false, render: function (rowdata, rowindex, value){
               	var  h = "<a href='javascript:detailProductHistory(" + rowindex + ")'>查看历史</a>  ";
                return h;
            	}
            }
            ], 
            pageSize:30,
            width: '100%',height:'100%',
            data: $.extend(true,{},productData)
        });

        

    });
    function detailProductHistory(rowindex){
    	
       	 var gNo=grid.getData()[rowindex].gNo;
       	 var url=basePath+'/product/productmgt/list_product_history.do?gNo='+gNo;
       	 url+="&pTabid="+WIN_TAB.getSelectedTabItemID();
       	 window.parent.f_addTab('商品详细', '商品详细',url );
       	 
    	
    }
    
    </script>




</body>
</html>